package ch13;


public class Interest extends Option 
{

	// attributes
	private double interestRate;
	private Keypad keypad;


	public Interest(int customerID, Screen atmScreen,
			BankDatabase atmBankDatabase) 
	{
	    // initialize superclass variables
		super(customerID, atmScreen, atmBankDatabase);
	}

	// perform Option
	@Override
	public void execute() {
	}// end method excute

	
	// Admin calls GetInterest method to get interest rate for specific account type
	public double getInterest(String type) {
		
		// decide how to proceed based on Admins new account type selection
		switch (type) 
		{
		
		// user chose to perform one of five options to create new account type
		case "MainAccount":
			interestRate = 2;
		case "LoanAccount":
			interestRate = 4;
		case "SavingsAccount":
			interestRate = 4;
		case "HomeLoanAccount":
			interestRate = 5;
		case "CarLoanAccount":
			interestRate = 1;
			break;
		// if Admin enters different account type than case 1-5, 
		default: // default will then allow Admin to enter a new interest to that specific new established account type
			System.out
					.println("Not predefined Account, type in interestRate for this account:\n");
		
			double input = keypad.getInput();
			interestRate = input; // Admin input equals the interest rate for the new account which name is not predifined
		

		} // end Switch
		return interestRate;
	} // end method getInterest
} // end class Interest
